const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  devServer: {
    proxy: {
      /*获取部门信息的代理地址*/
      '/dept/queryAll': {
        target: 'http://localhost:8001/dept/queryAll', //接口域名
        changeOrigin: true,             //是否跨域
        pathRewrite: {                  //路径重置
          '^/dept/queryAll': ''
        }
      },
      /*用户登录的代理地址*/
      '/user/login': {
        target: 'http://localhost:8001/user/login', //接口域名
        changeOrigin: true,             //是否跨域
        pathRewrite: {                  //路径重置
          '^/user/login': ''
        }
      },
      /*用户注册的代理地址*/
      '/user/register':{
        target: 'http://localhost:8001/user/register', //注册域名
        changeOrigin: true,
        pathRewrite: {
          '^/user/register':''
        }
      },
      /*获取用户列表*/
      '/user/userList': {
        target: 'http://localhost:8001/user/userList', //用户列表
        changeOrigin: true,
        pathRewrite: {
          '^/user/userList': ''
        }
      },
      /*添加系统用户*/
      '/user/userAdd': {
        target: 'http://localhost:8001/user/userAdd', //列表中添加用户
        changeOrigin: true,
        pathRewrite: {
          '^/user/userAdd': ''
        }
      },
      /*删除系统用户*/
      '/user/userRemove': {
        target: 'http://localhost:8001/user/userRemove', //列表中添加用户
        changeOrigin: true,
        pathRewrite: {
          '^/user/userRemove': ''
        }
      },
      /*显示系统菜单*/
      '/menu/menuAll': {
        target: 'http://localhost:8001/menu/menuAll', //左侧菜单栏的显示
        changeOrigin: true,
        pathRewrite: {
          '^/menu/menuAll': ''
        }
      },

    }
  },
  transpileDependencies: true
})
